{% extends "admbase.html" %}
{% from "bootstrap/pagination.html" import render_pagination %}
{% block page_content %}
<div class="page-header">
  <div align="center">
    <h1>管理主页</h1>
  </div>
</div>
<div class="container">
  <div class="row" style='BORDER: 1px inset; padding:10px; '>
    <div>
      <form method="POST">
        {{ form.csrf_token }}
          <div class="form-group">
            <div class="col-md-2">{{ form.field(class='form-control') }}</div>
            <div class="col-md-2">{{ form.keyword(class='form-control') }}</div>
            
            <button name="search" type="submit" value="search" class="btn btn-success">
              <span class="glyphicon glyphicon-search"></span>搜索
            </button>
            <!-- 单击刷新页面 -->
            <button class="btn btn-default" onclick="location.reload()">
              <span class="glyphicon glyphicon-ban-circle"></span>取消
            </button>
            <a class="btn btn-warning" data-toggle="modal" 
              href="#modal_submit">
              <span class="glyphicon glyphicon-trash"></span>删除
            </a>
          </div>

        <div class="container">
          <div class="modal" id="modal_submit">
            <div class="modal-dialog">
              <div class="modal-content">
                  <div class="modal-header">
                    <button type="button" 
                      class="close" data-dismiss="modal">
                      <span aria-hidden="true">&times;</span>
                      <span class="sr-only">close</span>
                    </button>
                    <h4 class="modal-title text-center">请确认</h4>
                  </div>
                  <div class="modal-body">确定删除吗？</div>
                  <div class="modal-footer">
                    <button name="delete" type="submit" value="delete"  
                      class="btn btn-danger btn-sm">
                      <span class="glyphicon glyphicon-trash"></span>删除
                    </button>
                    <button class="btn btn-default" data-dismiss="modal">
                      <span class="glyphicon glyphicon-ban-circle">取消
                    </button>
                  </div>
                </div>
              </div>
            </div>
        </div>
      </form>
    </div>
    <!-- 用两个表格实现表格内容滚动时，标题栏不动的效果 -->
    {% include "admined_table.html" %}
    {% if users  and nosearch %}
      <div class="page-footer text-center">
        {{ render_pagination(pagination) }}
      </div>
    {% endif %}
  </div>
</div>
{% endblock %}